package com.wcx.application.config;


import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class MyCustomAnnotationAspect {

    @Pointcut("@annotation(com.wcx.application.config.MyCustomAnnotation)")
    public void annotatedWithMyCustomAnnotation() {}

    @After("annotatedWithMyCustomAnnotation()")
    public void afterAnnotatedMethod(JoinPoint joinPoint) {
        // 在标记了@MyCustomAnnotation的方法执行后执行此逻辑
        System.out.println("Method " + joinPoint.getSignature().getName() + " with @MyCustomAnnotation has been executed.");
        // 这里你可以编写逻辑来清除Redis缓存、记录日志等
    }
}